/**
 * 
 */
package com.example.envatoandroid.db;

import com.example.envatoandroid.util.AppConstant;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @author niam
 *
 */
public class CommonDatabaseHelper extends SQLiteOpenHelper
{
	private static CommonDatabaseHelper instance = null;
	
	private UserInfoDatabase db;
	private Context context;
	
	private DatabaseHelper[] dbHelper = {
			UserInfoDatabase.getInstance(context)
	};
	
	private CommonDatabaseHelper(Context context)
	{
		super(context, AppConstant.DATABASE_NAME, null, AppConstant.DATABASE_VERSION);
		this.context = context;
	}
	
	public static CommonDatabaseHelper getInstance(Context context)
	{
		if (instance == null)
		{
			instance = new CommonDatabaseHelper(context);
		}
		return instance;
	}
	
	@Override
	public void onCreate(SQLiteDatabase db)
	{
		for (int i=0 ; i<dbHelper.length ; i++)
		{
			dbHelper[i].onCreate(db);
		}
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)
	{
		
	}

}
